//滚动侦测
var waypoint = new Waypoint({
    element: document.getElementById('waypoint'),
    handler: function (direction) {
        if (direction == 'down') {
            $('#toolBar').show(1000)
        } else {
            $('#toolBar').hide(500)
        }
        console.log('Scrolled to waypoint!' + direction)
    }
})

//平滑滚动
$('#toTop-Button').click(function () {
    $(window).scrollTo(0, 1000);
});


/*目录生成插件的初始化文件*/
tocbot.init({
    // Where to render the table of contents.
    tocSelector: '.js-toc',
    // Where to grab the headings to build the table of contents.
    contentSelector: '.js-toc-content',
    // Which headings to grab inside of the contentSelector element.
    headingSelector: 'h1, h2, h3',
    // For headings inside relative or absolute positioned containers within content.
    hasInnerContainers: true,
});

/*弹出微信*/
$('.wechat')
    .popup({
        popup: $('.wechat-qr'),
        position: 'left center'
    });

//二维码的生成

var serurl = /*[[#{blog.serurl}]]*/"127.0.0.1:8080";
var url = /*[[@{/blog/{id}(id=${blog.id})}]]*/"";

var qrcode = new QRCode("qrcode", {
    text: serurl+url,
    width: 120,
    height: 120,
    colorDark: "#000000",
    colorLight: "#ffffff",
    correctLevel: QRCode.CorrectLevel.H
});



